﻿using UnityEngine;
using System.Collections;

public class light_cont : MonoBehaviour {
    GameObject light_obj;
    public Light plight;
    public GameObject light_pos;
	void Start () {
        light_obj = new GameObject();
        light_obj.AddComponent<Light>();
        light_obj.GetComponent<Light>().type = LightType.Point;
        light_obj.name = "mylight";
        light_obj.transform.position = light_pos.transform.position;
        light_obj.GetComponent<Light>().color = Color.red;
        light_obj.GetComponent<Light>().range = 4;
        light_obj.GetComponent<Light>().intensity = 4;

        plight.color = Color.yellow;
    }
	
	public void changeColor(Color lightColor)
    {
        light_obj.GetComponent<Light>().color = lightColor;
    }
    public void changeIntensity(float lightIntensity)
    {
        light_obj.GetComponent<Light>().intensity = lightIntensity;
    }
}
